home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / HyperCard Related / APDA HyperCard Toolkits / AppleTalk ToolKit / NBP / NBPOpen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-07  |  2.2 KB  |  75 lines  |  [TEXT/MPS ]

  1. /*******************************************************************\
  2. *    file:         NBPOPen.c                                            *
  3. *    version:    1.06ß                                                *
  4. *                                                                     *
  5. * Create the control block and initialize the data for access to the*
  6. * name binding protocol (nbp) stuff.                                *
  7. *                                                                    *
  8. * -----------------------------------------------------------------    *
  9. * By:    Donald Koscheka                                                *
  10. * Date:    14-January, 1988                                            *
  11. * ©    Copyright 1988, Apple Computer, Inc.                            *
  12. *    All Rights Reserved                                                *
  13. *                                                                    *
  14. * -----------------------------------------------------------------    *
  15. *                        Modification History                        *
  16. * -----------------------------------------------------------------    *
  17. *  Date           | By    |                     Description                    *
  18. * -----------------------------------------------------------------    *
  19. * 14-Jan-88    | DK    | file created                                    *
  20. * -----------------------------------------------------------------    *
  21. \*******************************************************************/
  22.  
  23. /*******************************************************************\
  24.                             Build Sequence
  25.                             
  26. C -q2 -g -o "{hpo}"NBPOpen.c.o "{nbp}"NBPOpen.c
  27.     link  -sn Main=NBPOpen -sn STDIO=NBPOpen ∂
  28.          -sn INTENV=NBPOpen -rt XCMD=308 ∂
  29.          -m NBPOPEN ∂
  30.           "{hpo}"NBPOpen.c.o "{hpo}"atalkxcmd.c.o "{hpo}"xcmdutils.c.o ∂
  31.          "{CLibraries}"CRuntime.o ∂
  32.          "{CLibraries}"CInterface.o ∂
  33.          "{Libraries}"Interface.o ∂
  34.          -o "{hp}"HyperAppleTalk
  35.  
  36. \*******************************************************************/
  37.  
  38. #include <Types.h>
  39. #include <Memory.h>
  40. #include <Resources.h>
  41. #include <OSUtils.h>
  42. #include <appleTalk.h>
  43. #include <HyperXCmd.h>
  44. #include <atalkXCMD.h>
  45. #include <XCMDUtils.h>
  46.  
  47.  
  48. pascal void NBPOpen( paramPtr )
  49.     XCmdBlockPtr    paramPtr;
  50. /**********************************
  51. * In:
  52. *    params[0]    char    *NodeType
  53. *
  54. * Defaults : CLIENT/SERVER
  55. *
  56. * Out: Error Result is returned to hypercard
  57. **********************************/
  58. {
  59.     NBPBlock     *nbp    = nil;
  60.     short        error    = noErr;
  61.  
  62.     /*** Don't reopen if ATStuff is already allocated ***/
  63.     nbp = (NBPBlock *)RetrieveHandle( paramPtr, GLOBALNBPDATA );
  64.     if( !nbp ){ 
  65.         nbp = NBPInit();
  66.         SaveHandle( paramPtr, GLOBALNBPDATA, nbp );
  67.  
  68.         if( !nbp )
  69.             error = DEFAULT_ERROR;
  70.     }    
  71.  
  72.     paramPtr->returnValue = ErrorReturn( error );
  73.     
  74. }
  75.